import React,{Component} from 'react'
import { baseRoutes } from '@routes'
import { Route,Switch,Redirect } from 'react-router-dom'


export default class App extends Component{
  render(){
    return (
      <Switch>
        {
          baseRoutes.map((route)=>{
            return (
              <Route
                key={route.path}
                path={route.path}
                component = {route.component}
              />
            )
          })
        }
        <Redirect to="/admin" from="/" exact/>
        <Redirect to="/404"/>
      </Switch>
    )
  }
}